package com.neuedu.handler;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neuedu.service.CommonService;
import com.neuedu.vo.SelectItem;

@RestController
@RequestMapping("/common")
public class CommonHandler {

	@Autowired
	private CommonService cs;
	
	@RequestMapping("/uuid")
	public String getUUID() {
		return cs.getUUID();
	}
	
	@RequestMapping("/areaListByLv")
	public List<SelectItem<Integer, String>> getAreaListByLevel(Integer level){
		return cs.getAreaListByLevel(level);
	}
	
	@RequestMapping("/areaListByUp")
	public List<SelectItem<Integer, String>> getAreaListByUpper(Integer upper){
		return cs.getAreaListByUpper(upper);
	}
	
	@RequestMapping("/communitiesListByDistrict")
	public List<SelectItem<Integer, String>> getCommunitiesListByDirectID(Integer district){
		return cs.getCommunitiesListByDirectID(district);
	}
	
	@RequestMapping("/constantItemList")
	public List<SelectItem<Integer, String>> getConstantItemListByType(Integer constantTyep){
		return cs.getConstantItemListByType(constantTyep);
	}
	
	@RequestMapping("/companyList")
	public List<SelectItem<Integer, String>> getCompanyList(){
		return cs.getCompanyList();
	}
	
	@RequestMapping("/agentListByCompany")
	public List<SelectItem<Integer, String>> getAgentListByCompany(Integer compid){
		return cs.getAgentListByCompany(compid);
	}
}
